<%-- 
    Document   : index
    Created on : Oct 25, 2009, 10:09:20 PM
    Author     : Phong
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<%@ page import="java.sql.*" %>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        
        <link rel="stylesheet" href="css/style.css" />
        <link rel="stylesheet" href="css/front.css"  />
        
        
        <title>Themes</title>
    </head>
    
    <script type="text/javascript">
        if (document.all){
            document.onkeydown = function (){
                var key_f5 = 116; // 116 = F5
                if (key_f5==event.keyCode){
                    event.keyCode = 27;
                    return false;
                }
            }
        }

    </script>
    <jsp:include page="time.jsp" />
    <body bgcolor="#154978">
        <%
        if (session.getAttribute("UserName") == null) {
            response.sendRedirect("Login.jsp");
        }
        
        %>
        
        <table width="1024" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" align="center">
            <!--DWLayoutTable-->
            <tr>
                <td width="1024" height="157" valign="top" background="images/Banner.jpg">
                    
                </td>
            </tr>
            <tr>
                <td height="463" valign="top">
                    <table width="100%" border="0" cellpadding="2" cellspacing="2">
                        <!--DWLayoutTable-->
                        <tr>
                            <td height="39" colspan="3" valign="top" background="images/button/bg_login.gif">
                                
                                <%@include file="include/loginBar.jsp" %>   
                            </td>
                        </tr>
                        <tr>
                            <td width="670" rowspan="2"  valign="top" bgcolor="#CCCCCC">
                                <noscript>
                                    Ban khong duoc tat che do JavaScript
                                </noscript>
                                <form action="Result.jsp" name="myForm" method="post">
                                    <span id="mincountdown"></span> phút
                                    (<span id="seccountdown"></span> giây)
                                    <jsp:useBean id="Obj" class="DAO.DAOQuery" scope="request" />
                                    
                                    <%
                                   // out.println(request.getParameter("Test"));
                                    String[] charater = {"A", "B", "C", "D", "E", "F", "G", "H"};
                                    int ida = Integer.parseInt(request.getParameter("id"));
          
                                    int j = 0;
                                    int i=1;
                                    ResultSet rs = null;
                                    ResultSet rss = null;
                                    rs = Obj.selectQuestion(ida);
                                    while (rs.next()) {
                                    %>
                                    <P style="font-size:18px"><%=i%> . <%=rs.getString("ContentQuestion")%></P>
                                    <%
                                    int id = Integer.parseInt(rs.getString("QuestionID"));
                                    rss = Obj.selectAnswer(id);
                                    %>
                                    <input type="hidden" name="QuestionID" value="<%=id%>" />
                                    <%
                                    while (rss.next()) {
                                    %>
                                    <input type="checkbox" name="Choice" value="<%=rss.getString("AnswerID")%>"/><%=charater[j]%> . <%=rss.getString("AnswerContent")%> <br>
                                    <%
                                    j++;
                                    }
                                    %>
                                    <%
                                    i++;
                                    j = 0;
                                    }
                                    %>
                                    <br>
                                    <input type="hidden" value="<%=request.getParameter("time1")%>" name="timeStart">
                                    <input type="hidden" value="<%=new java.util.Date()%>" name="timeEnd">
                                    <input type="hidden" value="<%=request.getParameter("Test")%>" name="Testid">
                                    <input type="hidden" value="<%=ida%>" name="subid">
                                    <input type="button" value="Submit" onclick="doSubmit();"  />
                                </form>
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
        </table>
    </body>
</html>
